package com.newlink.building.record.mvp.model

import com.newlink.building.common_base.base.BaseModel
import com.newlink.building.common_base.http.Base_RetrofitHelper
import com.newlink.building.common_base.model.bean.Base_BaseBean
import com.newlink.building.common_base.model.bean.CallRecordData
import com.newlink.building.common_base.model.bean.HttpResult
import com.newlink.building.common_base.model.bean.RecordMessageReadRequest
import com.newlink.building.record.mvp.contract.Module_Record_CallRecordContract
import io.reactivex.Observable

/**
 * @author wangyang
 * @date 2022/9/29
 * @description 记录-呼叫记录页面的Model
 */
class Module_Record_CallRecordModel : BaseModel(), Module_Record_CallRecordContract.Model {

    override fun getCallRecordList(
        token: String,
        page: Int,
        limit: Int,
        sip: String
    ): Observable<HttpResult<CallRecordData>> {
        return Base_RetrofitHelper.service.getCallRecordList(token, page, limit, sip)
//        KcpTaskHelper.instance.requestCallLogs(
//            CallLogsRequest(
//                accessToken = token,
//                uId = userId,
//                requestType = "callRecord/list",
//                data = CallRecordRequestBody(
//                    sip, page, limit
//                )
//            )
//        )
    }

    override fun readMissedCalls(
        token: String,
        request: RecordMessageReadRequest
    ): Observable<Base_BaseBean> {
        return Base_RetrofitHelper.service.readMissedCalls(token, request)
    }
}